import glob from 'glob'

export async function getFilesPath(cwd: string, pattern = '**/*') {
  return new Promise<string[]>((resolve, reject) => {
    glob(pattern, { cwd, nodir: true }, (err, matches) => {
      if (err) {
        reject(err)
      } else {
        resolve(matches)
      }
    })
  })
}
